function sendform(formname){
 switch(formname){
  case 'notfound': 
  case 'quoterequest': 
  case 'volumediscount': if(checkf(formname))document.forms[formname].submit(); break;
  case 'logto': if(checklogto())document.forms['logto'].submit(); break;
  case 'forgotm': if(checadr())document.forms['forgotm'].submit(); break;
  default: return false;
 }
}
function checkf(a){
 var current=null;
 for(var i=1;i<4;i++){
  current=document.forms[a].elements[i];
  if(!current.value){
   alert('You haven\'t filled in '+'\"'+ current.name+'\"'+'\ !');
   return false;
  }
 }
 if(cem(document.forms[a].elements[3].value)) return true;
 else return false;
}
var vv="1234567890qwertyuiopasdfghjklzxcvbnmQWERTYUIOPASDFGHJKLZXCVBNM";
function checadr(){
 var current=document.forms['forgotm'].elements[0];
 if(!cem(current.value)) return false;
 return true;
}
function checklogto(){
 var current=document.forms['logto'].elements[0];
 if(!cem(current.value)) return false;
 current=document.forms['logto'].elements[1];
 var s=current.value;
 var t=1;
 if(s){
  for(var i=0;i<s.length;i++) if(vv.indexOf(s.charAt(i))==-1) {t=0;break;}
 }
 if(!s||!t){
  alert('Your password is not valid!');
  return false;
 }
 return true;
}
var va="1234567890qwertyuiop[]asdfghjklzxcvbnm.@-_QWERTYUIOPASDFGHJKLZXCVBNM";
var vb=/(@.*@)|(\.\.)|(^\.)|(^@)|(@$)|(\.$)|(@\.)|(@\-)|(-\.)/;
var vc=/^.+\@(\[?)[a-zA-Z0-9\-\.]+\.([a-zA-Z]{2,4}|[0-9]{1,3})(\]?)$/;
function cem(e){
 var a=1;
 var b=-1;
 for(i=0;i<e.length;i++) if(va.indexOf(e.charAt(i))==-1) a=-1;
 if((!e.match(vb))&&(e.match(vc))) b=1;
 if(e.length<6||a<0||b<0){
  alert('Your e-mail address: '+e+' is not valid!');
  return false;
 }
 return true;
}
